﻿<%@ Page Language="C#" AutoEventWireup="true" Codebehind="AddStaff.aspx.cs" Inherits="LabMS.Web.LabPersonnel.AddStaff" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>添加人员基本信息</title>
    <link type="text/css" rel="stylesheet" href="../style/screen.css" />
    <!--[if lte IE 6]>
    <link type="text/css" rel="stylesheet" href="../style/ie6.css" />
    <![endif]-->
    <!--[if lte IE 7]>
    <link type="text/css" rel="stylesheet" href="../style/ie7.css" />
    <![endif]-->

    <script src="../../js/calendar5.js" type="text/javascript"></script>

    <script src="../../js/Common.js" type="text/javascript"></script>

    <script type="text/javascript">
     function OpenSubjectEditWin(frmWin,width,height) 
      {       
           var me; 
           me = window;  
           var ret = window.showModalDialog(frmWin,me,'dialogWidth='+width +'px;dialogHeight='+height+'px;help:no;status:no');
           if (ret != null) 
           { 
               document.getElementById("tbSubjectCode").value = ret[0];
               document.getElementById("StaffSubject").value = ret[1];
           }  
      }
      function OpenStaffTitleEditWin(frmWin,width,height) 
      {       
           var me; 
           me = window;  
           var ret = window.showModalDialog(frmWin,me,'dialogWidth='+width +'px;dialogHeight='+height+'px;help:no;status:no');
           if (ret != null) 
           { 
               document.getElementById("tbStaffTitleCode").value = ret[0];
               document.getElementById("StaffTitle").value = ret[1];
           }  
      }
      function OpenDisciplineEditWin(frmWin,width,height) 
      {       
           var me; 
           me = window;  
           var ret = window.showModalDialog(frmWin,me,'dialogWidth='+width +'px;dialogHeight='+height+'px;help:no;status:no');
           
           if (ret != null) 
           { 
                var value = document.getElementById("tbDesciplineCode").value;
                var listID = value.split(';');
                for(var j=0; j<ret.Items.length; ++j)
                {
                    var item = ret.Items[j];
                    var HasID = false;
                    for(var i=0; i<listID.length; ++i)
                    {
                        if(listID[i] == item.Code)
                        {
                            HasID = true; 
                        }  
                    } 
                    if(!HasID)
                    {
                        if(document.getElementById("tbDesciplineCode").value != "")
                        {
                            document.getElementById("tbDesciplineCode").value += ";" + item.Code;
                            document.getElementById("StaffDisciplines").value += ";" + item.Name;
                        }
                        else
                        {
                            document.getElementById("tbDesciplineCode").value += item.Code;
                            document.getElementById("StaffDisciplines").value += item.Name;
                        }
                    }
                }             
            }  
       }
    var d = new Calendar("d");
    document.write(d);
    </script>

</head>
<body class="mainBody">
    <form id="form1" runat="server" enctype="multipart/form-data">
        <div class="main">
            <div id="pageInfo" class="clearfix">
                <div class="title">
                    <label>
                        <a href="ListStaff.aspx">人员基本信息列表</a></label>&gt;添加人员基本信息
                </div>
            </div>
        </div>
        <div class="main">
            <p>
                <asp:Button ID="SubmitBtn" CssClass="button" Text="保存" runat="server" OnClick="Submit_OnClick" />
                <input id="ReturnBtn" type="button" class="button" runat="server" onclick="RedirectURL(window,'ListStaff.aspx')"
                    value="返回" />
            </p>
            <table cellpadding="2" cellspacing="0" border="0">
                <tr>
                    <td>
                        <label class="itemTitle">
                            人员编号：</label><span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffID" runat="server" MaxLength="25"></asp:TextBox>
                    </td>
                    <td>
                        <label class="itemTitle">
                            姓名：</label><span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffName" runat="server" MaxLength="25"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            性 别：</label><span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:DropDownList ID="StaffSexDDL" DataTextField="Name" DataValueField="Code" runat="server" />
                    </td>
                    <td>
                        <label class="itemTitle">
                            实验室：</label><span style="color: Red">*</span></td>
                    <td>
                        <asp:DropDownList ID="StaffLabDDL" DataTextField="Lab_Name" DataValueField="ID" runat="server">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            出生年月：</label><span style="color: Red">*</span>&nbsp;<span style="color: Red"></span>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffBirth" runat="server"></asp:TextBox></td>
                    <td>
                        <label class="itemTitle">
                            文化程度：</label><span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:DropDownList ID="StaffEducationDDL" DataTextField="Name" DataValueField="Code"
                            runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            毕业时间：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffGraduteTime" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <label class="itemTitle">
                            毕业院校：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffGradInstitution" runat="server" MaxLength="25"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            参加工作时间：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffTakeInJob" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <label class="itemTitle">
                            所属学科：</label><span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffSubject" runat="server"></asp:TextBox>
                        <input id="btSubjectselect" name="btSubjectselect" onclick="OpenSubjectEditWin('../../Equipment/Dictionary.aspx?Type=Subject',500,400)"
                            type="button" value="..." class="button" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            专业方向：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffProfessional" runat="server" MaxLength="25"></asp:TextBox>
                    </td>
                    <td>
                        <label class="itemTitle">
                            实验室工龄：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffLabSeniority" runat="server" MaxLength="4"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            职 称：</label><span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffTitle" runat="server"></asp:TextBox>
                        <input id="btStaffTitleselect" name="btStaffTitleselect" onclick="OpenStaffTitleEditWin('../../Equipment/Dictionary.aspx?Type=Position',500,400)"
                            type="button" value="..." class="button" />
                    </td>
                    <td>
                        <label class="itemTitle">
                            主讲课程：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffDisciplines" runat="server"></asp:TextBox>
                        <input id="btDisciplineselect" name="btDisciplineselect" onclick="OpenDisciplineEditWin('ChooseCourseList.aspx',500,400)"
                            type="button" value="..." class="button" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            评职时间：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffPositionTime" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <label class="itemTitle">
                            任聘情况：</label>
                    </td>
                    <td>
                        <asp:DropDownList ID="StaffEmployDDL" DataTextField="Name" DataValueField="Code"
                            runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            实验室工作时间：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffLabTime" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <label class="itemTitle">
                            主要工作：</label></td>
                    <td>
                        <asp:DropDownList ID="StaffWorkDDL" DataTextField="Name" DataValueField="Code" runat="server">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            论文数量：</label></td>
                    <td>
                        <asp:TextBox ID="StaffPaperNum" runat="server" MaxLength="4"></asp:TextBox></td>
                    <td>
                        <label class="itemTitle">
                            论文级别：</label></td>
                    <td>
                        <asp:DropDownList ID="StaffPaperLevelDDL" DataTextField="Name" DataValueField="Code"
                            runat="server">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            著作数量：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffPublicationsNum" runat="server" MaxLength="4"></asp:TextBox></td>
                    <td>
                        <label class="itemTitle">
                            著作级别：</label></td>
                    <td>
                        <asp:DropDownList ID="StaffPublicationsLevelDDL" DataTextField="Name" DataValueField="Code"
                            runat="server">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            工 作 量：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffWorkload" runat="server" MaxLength="25"></asp:TextBox>
                    </td>
                    <td>
                        <label class="itemTitle">
                            一外语种：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffForeignLanguage" runat="server" MaxLength="25"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            一外水平：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffForeignLevel" runat="server" MaxLength="25"></asp:TextBox>
                    </td>
                    <td>
                        <label class="itemTitle">
                            在研课题：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffResearchSub" runat="server" MaxLength="25"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            课题级别：</label>
                    </td>
                    <td>
                        <asp:TextBox ID="StaffSubjectLevel" runat="server" MaxLength="25"></asp:TextBox>
                    </td>
                    <td>
                        <label class="itemTitle">
                            人员类别：</label><span style="color: Red">*</span>
                    </td>
                    <td>
                        <asp:DropDownList ID="StaffPartTimeDDL" DataTextField="Name" DataValueField="Code"
                            runat="server">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            成果奖励：</label></td>
                    <td>
                        <asp:TextBox ID="StaffAward" runat="server" MaxLength="25"></asp:TextBox></td>
                    <td>
                        <label class="itemTitle">
                            人员类别等级：</label>
                    </td>
                    <td>
                        <asp:DropDownList ID="StaffLevelDDL" DataTextField="Name" DataValueField="Code" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <%--<tr>
                <td>
                    专家类别<span style="color:Red">*</span>
                </td>
                <td>
                    <asp:CheckBoxList ID="StaffExpertLevel" DataTextField="Name" DataValueField="Code" RepeatColumns="3" RepeatDirection="Horizontal" runat="server" />                        
                </td>
            </tr>--%>
                <tr>
                    <td>
                        <label class="itemTitle">
                            相 片：</label>
                    </td>
                    <td>
                        <asp:FileUpload ID="ImageUpload" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        <label class="itemTitle">
                            备 注：</label>
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="StaffSummary" runat="server" TextMode="MultiLine" Rows="5" Width="500"
                            Height="100" MaxLength="150"/>
                    </td>
                </tr>
            </table>
        </div>
        <asp:TextBox ID="tbSubjectCode" Style="visibility: hidden" runat="server"></asp:TextBox>
        <asp:TextBox ID="tbStaffTitleCode" Style="visibility: hidden" runat="server"></asp:TextBox>
        <asp:TextBox ID="tbDesciplineCode" Style="visibility: hidden" runat="server"></asp:TextBox>

        <script type="text/javascript" src="../js/jQuery/jquery-1.3.1.js"></script>

        <script type="text/javascript" src="../js/jQuery/jquery.validate.js"></script>

        <script type="text/javascript">
        $(document).ready(function(){
            $("#form1").validate({
                rules: {
                    StaffID:{
                            required:true
                    },
                    StaffName:{
                            required:true
                    },
                    StaffBirth:"required",
                    StaffSubject:"required",
                    StaffTitle:"required",
                    StaffLabSeniority:{
                            number:true
                    },
                    StaffPaperNum:{
                            number:true
                    },
                    StaffPublicationsNum:{
                            number:true
                    },
                    ImageUpload:{
                        accept:'jpg|bmp|png|gif'
                    }
                },
                messages: {
                    StaffID:{
                        required:"请输入人员编号"
                    },
                    StaffName:{
                        required:"请输入人员姓名"
                    },
                    StaffBirth:"请选择出生日期",
                    StaffSubject:"请选择所属学科",
                    StaffTitle:"请选择职称",
                    StaffLabSeniority:{
                        number:"请输入数字"
                    },
                    StaffPaperNum:{
                        number:"请输入数字"
                    },
                    StaffPublicationsNum:{
                        number:"请输入数字"
                    },
                    ImageUpload:{
                        accept:"请输入正确格式的图片"
                    }
                }
            });
        });
        </script>

    </form>
</body>
</html>
